<%@ include file="../header.jsp" %>

<h2>Ajouter un produit</h2>

<form method="post" name="formAjoutProduit" id="formAjoutProduit" action="ajoutproduit" enctype="multipart/form-data">
	<fieldset>
	<legend>Produit</legend>
	<p class="double">
		<span class="gauche">
			<label for="intitule">Intitule* : </label>
			<span class="correction" id="intitule-correction"></span>
			<span class="info" id="intitule-info">maximum 80 caract&egrave;res</span>
		</span>
		<span class="droite">
			<input type="text" name="intitule" id="intitule" onfocus="javascript:afficheInfo('intitule-info')"  onblur="javascript:verifValeurText('intitule', 'formAjoutProduit', 80)" value="<c:out value="${param.intitule}" />" />
			<span id="pseudo-valid">&nbsp;</span>
		</span>
	</p>
	
	<p class="double">
		<span class="gauche">
			<label for="type">Type* : </label>
			<span class="correction" id="type-correction"></span>
			<span class="info" id="type-info">doit &ecirc;tre choisit</span>
		</span>
		<span class="droite">
			<select name="type" id="type" onfocus="javascript:afficheInfo('type-info')"  onblur="javascript:verifValeurSelect('type', 'formAjoutProduit')">
				<option value="<c:out value="null" />">Choississez un type de produit</option>
				<c:forEach var="type" items="${requestScope.types}" >
					<option value="<c:out value="${type.key}" />"><c:out value="${type.value}" /></option>
				</c:forEach>
			</select>
			<span id="type-valid">&nbsp;</span>
		</span>
	</p>
	
	<p class="double">
		<span class="gauche">
			<label for="desc">Description* : </label>
			<span class="correction" id="desc-correction"></span>
			<span class="info" id="desc-info"></span>
		</span>
		<span class="droite">
			<textarea name="desc" onfocus="javascript:afficheInfo('desc-info')"><c:out value="${param.desc}" /></textarea>
			<span id="desc-valid" class="correction">&nbsp;</span>
		</span>
	</p>
	
	<p class="double">
		<span class="gauche">
			<label for="photo">Photo : </label>
			<span class="info" id="photo-info">Cette photo doit &ecirc;tr repr&eacute;sentative de l'objet pour que le produit soit identif&eacute; en un coup d'oeil.</span>
		</span>
		<span class="droite">
			<input type="file" name="file" id="photo" onfocus="javascript:afficheInfo('photo-info')" />
			<span id="photo-valid">&nbsp;</span>
		</span>
	</p>
	
	<p class="simple">
		<input type="submit" value="Envoyer" />
	</p>
	</fieldset>
</form>

<ul>
	<c:forEach var="erreur" items="${requestScope.erreur}" >
		<li><c:out value="${erreur}" /></li>
	</c:forEach>
</ul>

<%@ include file="../footer.jsp" %>